package cn.sofwin.day0108.homework;

import java.util.Scanner;

public class Reverse {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        System.out.println("请输入一个整数");
        int number = sc.nextInt();
        int count = 0;
        int reverse = 0;
        int n = number;
        while (number > 0) {
            n = number % 10;
            number /=10;
            reverse = reverse * 10 + n;
            count++;

        }
        System.out.println("该整数为" + count + "位数");
        System.out.println("逆序为：" + reverse);
    }

}
